using Godot;
using System;

public partial class UiInteractTips : Ui
{
	private Player _player;
	private Label _interactTips;
	private GuiViewManager _guiViewManager;
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		var Game = GetNode<Game>("/root/Game");
		_player = Game.get_player();
		_interactTips = GetNode<Label>("%InteractTips");
		_guiViewManager = Game.get_main().GetNode<GuiViewManager>("%GuiViewManager");
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
		_interactTips.Text = (_player.CharacterData as PlayerData).InteractTips;
		if(this.Visible == true&&(_player.CharacterData as PlayerData).InteractTips != ""&&_guiViewManager.InstanceUIsList.Count != 0)
		{
			this.close_self();
		}
	}

    public override void enter()
    {
    }
	public override void exit()
	{}


}
